<template>
  <div class="container">
    <el-row type="flex" justify="space-between">
      <!-- 订单表单 -->
      <div class="main">
        <orderForm :dataList="dataList" @setTotal="setTotal" v-if="dataList" />
      </div>

      <!-- 侧边栏 -->
      <div class="aside">
        <orderAside :data="dataList" :res="res" v-if="dataList" />
      </div>
    </el-row>
  </div>
</template>

<script>
import orderForm from "@/components/air/orderForm";
import orderAside from "@/components/air/orderAside";
export default {
  data() {
    return {
      dataList: null,
      res: {}
    };
  },
  components: {
    orderForm,
    orderAside
  },
  created() {
    this.$axios({
      url: "/airs/" + this.$route.query.data,
      params: {
        seat_xid: this.$route.query.seat_xid
      }
    }).then(res => {
      console.log(res.data);
      this.dataList = res.data;
    });
  },
  methods: {
    setTotal(res) {
      this.res = res;
      console.log(res);
    }
  }
};
</script>

<style lang="less" scoped>
.container {
  width: 1000px;
  margin: 20px auto;
}

/*aside*/
.aside {
  width: 350px;
  height: fit-content;
  border: 1px #ddd solid;
}
</style>